const {getBannerList} = require("../../api/system.js")
Page({
  data: {
    // cardCur: 0,
    swiperList: [],
    scroll_height:0,
    itemList:[{'desc':'时尚造型，小巧可爱','title':'粉色时尚时钟','img':'../../images/product-1.jpg'},
    {'desc':'时尚造型，小巧可爱','title':'粉色时尚时钟','img':'../../images/product-2.jpg'},
    {'desc':'时尚造型，小巧可爱','title':'粉色时尚时钟','img':'../../images/product-3.jpg'},
    {'desc':'时尚造型，小巧可爱','title':'粉色时尚时钟','img':'../../images/product-4.jpg'},
    {'desc':'时尚造型，小巧可爱','title':'粉色时尚时钟','img':'../../images/product-1.jpg'},
    {'desc':'时尚造型，小巧可爱','title':'粉色时尚时钟','img':'../../images/product-2.jpg'},
    {'desc':'时尚造型，小巧可爱','title':'粉色时尚时钟','img':'../../images/product-3.jpg'},
    {'desc':'时尚造型，小巧可爱','title':'粉色时尚时钟','img':'../../images/product-4.jpg'}]
  },
  onLoad:function(options){
    let windowHeight = wx.getSystemInfoSync().windowHeight // 屏幕的高度
    let windowWidth = wx.getSystemInfoSync().windowWidth // 屏幕的宽度
    this.setData({
      scroll_height: windowHeight * 750 / windowWidth - 360
    })
   
  },
  onShow(){
    let that = this
    getBannerList().then(res=>{
      if(res.code == 200){
        this.setData({
          swiperList: res.data
        })
      }
    })
  },
  productDetail:function(){
    wx.navigateTo({
      url: '/pages/orderdetail/orderdetail',
    })
  }
})